Caption = "With the mouse: Click on the top or bottom box line to scroll as well."
DragMode = 0
Enabled = -1
ForeColor = QBColor(15)
Height = Char(1)
Left = Char(1)
MousePointer = 0
TabIndex = 19
Tag = ""
Top = Char(1)
Visible = -1
Width = Char(70)
END
END
DEFINT A-Z
'$FORM frmGeneral
'$FORM frmDemoFile
'$FORM frmOrder
' CzList Internal functions. These functions have to be declared if you
' want to use them.
DECLARE FUNCTION CzGetWhatKindMem% ()
DECLARE FUNCTION CzItemsTagged% ()
DECLARE FUNCTION CzAllowTagging% (YesNo%)
DECLARE FUNCTION CzKeybTagScrolling% (YesNo%)
DECLARE FUNCTION CzMouTagScrolling% (YesNo%)
DECLARE FUNCTION CzSetVirtualPath% (PathToSet$)
' Demo functions
DECLARE SUB CzDirDetails ()
DECLARE SUB CzDirDetails2 ()
DECLARE SUB AboutCzDir ()
SUB AboutCzDir ()
a$ = "CzDir is a directory listbox control for VBDOS. It displays an alphabetically sorted, graphical directory tree. It fully supports tagging and untagging."
a$ = a$ + CHR$(13) + CHR$(10)
a$ = a$ + CHR$(13) + CHR$(10) + "CzDir uses 2 memory areas in XMS, EMS or Disk files because it has to keep track of the graphical tree as well as the directory paths."
a$ = a$ + CHR$(13) + CHR$(10)
a$ = a$ + CHR$(13) + CHR$(10) + "CzDir will first try to use XMS Memory. If no XMS memory is available, it will try to use EMS Memory. If no XMS and no EMS memory is available, CzDir will use the disk as virtual memory."
MSGBOX a$, 0, "CzDir Demo"
END SUB
SUB chkAllowTag_Click ()
IF chkAllowTag.Value = 1 THEN
Result = CzAllowTagging(0)
Result = CzKeybTagScrolling(0)
Result = CzMouTagScrolling(0)
chkKeybTag.Enabled = -1
chkMouseTag.Enabled = -1
chkKeybTag.Value = 1
chkMouseTag.Value = 1
ELSE
Result = CzAllowTagging(1)
Result = CzKeybTagScrolling(1)
Result = CzMouTagScrolling(1)
chkKeybTag.Enabled = 0
chkMouseTag.Enabled = 0
END IF
END SUB
SUB chkKeybTag_Click ()
IF chkKeybTag.Value = 1 THEN
Result = CzKeybTagScrolling(0)
ELSE
Result = CzKeybTagScrolling(1)
END IF
END SUB
SUB chkMouseTag_Click ()
IF chkMouseTag.Value = 1 THEN
Result = CzMouTagScrolling(0)
ELSE
Result = CzMouTagScrolling(1)
END IF
END SUB
SUB cmdCancel_Click ()
' You must UNLOAD the form or control(s) before you end your program. CzDir
' will then remove itself from memory. If you do not unload the form or
' control, the memory used by CzDir (either XMS, EMS, or disk space) will
' not be released and unpredictable results may occur.
UNLOAD frmDemoDir
frmOrder.SHOW 1
END
END SUB
SUB cmdCzFile_Click ()
' You must UNLOAD the form or control(s) before you end your program. CzFile
' will then remove itself from memory. If you do not unload the form or
' control, the memory used by CzFile (either XMS, EMS, or disk space) will
' not be released and unpredictable results may occur.
UNLOAD frmDemoDir
frmDemoFile.SHOW 1
END SUB
SUB cmdTag_Click ()
' Tag all elements
' Value = 1 : tag alll elements in CzDir
' Value = 2 : untag alll elements in CzDir
CzDir.Value = 1
' Display the number of items tagged.
lblItemsTagged.Caption = STR$(CzItemsTagged)
CzDir.SETFOCUS
END SUB
SUB cmdUntag_Click ()
' Untag all elements
' Value = 1 : tag alll elements in CzDir
' Value = 2 : untag alll elements in CzDir
CzDir.Value = 2
' Display the number of items tagged.
lblItemsTagged.Caption = STR$(CzItemsTagged)
CzDir.SETFOCUS
END SUB
SUB CzDirDetails ()
a$ = "CzDir reads the disk every time you use CzDir.Drive = Drive$."
a$ = a$ + CHR$(13) + CHR$(10)
a$ = a$ + CHR$(13) + CHR$(10) + "Unless you unload the CzDir control, the tree and directory paths stay in memory (XMS, EMS, or Disk)."
MSGBOX a$, 0, "CzDir Demo"
END SUB
SUB CzDirDetails2 ()
a$ = " NOTE:"
a$ = a$ + CHR$(13) + CHR$(10)
a$ = a$ + CHR$(13) + CHR$(10) + "It will take a few moments until the entire directory tree is read from disk, sorted, and the tree and paths are saved."
MSGBOX a$, 0, "CzDir Demo"
END SUB
SUB CzDir_DblClick ()
' Get the current element and display it.
' CzDir.ListIndex is the current Index. You can also get any other
' index from 0 to ListCount. For example, to get element 189, use
' Dummy$ = CzDir.List(188). Remember, the list starts with element 0.